home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
202_01
/
sessions.doc
< prev
next >
Wrap
Text File
|
1980-01-01
|
12KB
|
867 lines
Editing Session I
To create a new file
- 1 -
A>ked b:blue1 b:blue2
TYPE MN TO SEE MENU
BEGINNING-OF-PROGRAM
<instruction>df
DEFINE-NEW-INSTRUCTION <new-name>AStr
DEFINE-NEW-INSTRUCTION tr AS
BEGIN
<instruction>tl
turnleft;
<instruction>tl
turnleft;
<instruction>tl
turnleft;
<instruction>nd
END;
<instruction>bx
BEGINNING-OF-EXECUTION
<instruction>m
move;
<instruction>if
IF <test>c
IF next-to-a-beeper
THEN
<instruction>b
BEGIN
<instruction>pi
pickbeeper;
<instruction>m
move;
<instruction>tr
tr;
<instruction>nd
END;
<instruction>el
ELSE
<instruction>m
move;
<instruction>ndc
<instruction>m
move;
<instruction>to
turnoff;
<instruction>ndx
END-OF-EXECUTION
END-OF-PROGRAM
- 2 -
?t
BEGINNING-OF-PROGRAM
?n
?DEFINE-NEW-INSTRUCTION ?n
tr AS
?d
ENTER REPLACEMENT <new-name>turnright
DEFINE-NEW-INSTRUCTION turnright AS
?t
BEGINNING-OF-PROGRAM
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
turnright;
END
ELSE
move;
move;
move;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
?s
?q
HAS PROGRAM BEEN SAVED ? (Y/N)
y
- 3 -
Editing Session II
To correct errors
in an old file
- 4 -
A>ked b:blue1 b:blue2
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
turnleft
END
ELSE
move;
move;
?t
BEGINNING-OF-PROGRAM
?nc
DEFINE-NEW-INSTRUCTION ?nc
BEGINNING-OF-EXECUTION
?n-
END;
?i
?tl
turnleft;
<instruction>nc
BEGINNING-OF-EXECUTION
?nc
IF ?nc
THEN
?nc
ELSE
?n-
END
?n-
turnleft
?d
turnleft
?i
?turnright
turnright;
<instruction>t
BEGINNING-OF-PROGRAM
- 5 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
turnright
END
ELSE
move;
move;
move;
turnoff
END-OF-EXECTION
END-OF-PROGRAM
END OF FILE
?s
?q
HAS PROGRAM BEEN SAVED? (Y/N)
y
- 6 -
Editing Session III
To illustrate insert
and delete features of KED
- 7 -
A>ked b:blue1 b:blue2
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF next-to-a-beeper
THEN
BEGIN
pickbeeper;
move;
tunrnright
END
ELSE
move;
move;
?t
BEGINNING-OF-PROGRAM
?nc
DEFINE-NEW-INSTRUCTION ?nc
BEGINNING-OF-EXECUTION
?nc
IF ?n
next-to-a-beeper
?d
ENTER REPLACEMENT <test>f
IF front-is-clear
?t
BEGINNING-OF-PROGRAM
- 8 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN
turnleft;
turnleft;
turnleft
END;
BEGINNING-OF-EXECUTION
move;
IF front-is-clear
THEN
BEGIN
pickbeeper;
move;
turnright
END
ELSE
move;
move;
move;
turnoff
END-OF-EXECUTION
END-OF-PROGRAM
END OF FILE
?n-
turnoff
?i
?it
ITERATE <positive-number> TIMES4
ITERATE 4 TIMES
<instruction>b
BEGIN
<instruction>wh
WHILE <test> DOb
WHILE any-beepers-in-beeper-bag DO
<instruction>pu
putbeeper;
<instruction>ndc
<instruction>m
move;
<instruction>nd
END;
<instruction>t
BEGINNING-OF-PROGRAM
- 9 -
?l
BEGINNING-OF-PROGRAM
DEFINE-NEW-INSTRUCTION turnright AS
BEGIN